# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-aniso8601
pkgver=9.0.1
pkgrel=5
pkgdesc="A library for parsing ISO 8601 strings."
url="https://bitbucket.org/nielsenb/aniso8601"
license=('BSD')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-pytest-runner' 'python-dateutil')
source=("$pkgname-$pkgver.tar.gz::https://bitbucket.org/nielsenb/aniso8601/get/v$pkgver.tar.gz")
sha512sums=('82b3c943fe3be845ee375e232c6aafb20d4ede560831f594e91ad75e93fd6d12316ad7285c6ebb796587ace27f56c4b0c17059d9c2d1aa9525394802ea19d00c')

prepare() {
  mv nielsenb-aniso8601-* aniso8601-$pkgver
}

build() {
  cd "$srcdir"/aniso8601-$pkgver
  python setup.py build
}

check() {
  cd "$srcdir"/aniso8601-$pkgver
  python setup.py pytest
}

package() {
  cd aniso8601-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
